package cn.ncu.wechat.controller;

import cn.ncu.wechat.model.MemberBenefit;
import cn.ncu.wechat.service.MemberBenefitService;
import cn.ncu.wechat.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/admin/member-benefits")
public class MemberBenefitController {
    @Autowired
    private MemberBenefitService memberBenefitService;

    @GetMapping("")
    public Result<?>getBenefitList(){
        return memberBenefitService.getBenefitList();
    }

    @PostMapping("")
    public Result<?>editOrAddBenefitList(@RequestBody MemberBenefit memberBenefit){
        return memberBenefitService.editOrAddBenefitList(memberBenefit);
    }
}
